package com.wangshouyu.mp.menu;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.wangshouyu.mp.base.response.BaseResponse;

import java.util.List;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月23日 16:56
 * @description 自定义菜单结果
 */
public class CustomMenuResponse extends BaseResponse {

    /**
     * 菜单编号
     */
    @SerializedName(value = "menuid")
    @JsonProperty(value = "menuid")
    @JSONField(name = "menuid")
    private String menuId;

    /**
     * 按钮
     */
    private Menu menu;

    /**
     * 自定义菜单
     */
    @SerializedName(value = "conditionalmenu")
    @JsonProperty(value = "conditionalmenu")
    @JSONField(name = "conditionalmenu")
    private List<CustomMenu> conditionalMenu;

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public Menu getMenu() {
        return menu;
    }

    public void setMenu(Menu menu) {
        this.menu = menu;
    }

    public List<CustomMenu> getConditionalMenu() {
        return conditionalMenu;
    }

    public void setConditionalMenu(List<CustomMenu> conditionalMenu) {
        this.conditionalMenu = conditionalMenu;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        CustomMenuResponse that = (CustomMenuResponse) o;
        return Objects.equals(menuId, that.menuId) && Objects.equals(menu, that.menu) && Objects.equals(conditionalMenu, that.conditionalMenu);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), menuId, menu, conditionalMenu);
    }

    @Override
    public String toString() {
        return "CustomMenuResponse{" +
                "menuId='" + menuId + '\'' +
                ", menu=" + menu +
                ", conditionalMenu=" + conditionalMenu +
                '}';
    }
}
